<?php
$this->headLink()->prependStylesheet(_STATIC_HTTP . '/www/css/account.css');
$this->headScript()->captureStart();
echo "oo.adaptive({'num': 5, 'id': 'mayLike'});";
$this->headScript()->captureEnd();
$expireSeconds = system_session::getOptions('remember_me_seconds');
$expireAttr = array('label' => (string) $this->language('下次自动登录'), 'checked' => 'checked');
if(!$this->expires) unset($expireAttr['checked']);
?>
<div class="box signupBox">
	<div class="hd">
		<h3 class="category"><?php echo $this->language('新用户注册');?> / <?php echo $this->language('登录');?></h3>
	</div>
	<div class="bd">			
		<?php if($this->exception) { ?>
		<div class="msg signupMsg">
			<div class="bd error">
				<i></i><code><a href="#close" onclick="$('.signupMsg').hide();return false;">&times;</a></code>			
				<div>
					<h3><?php echo $this->language('错误');?>:</h3>
					<p><?php echo $this->language($this->exception->getMessage());?></p>
				</div>
			</div>
		</div>
		<div class="clear"></div>
		<?php } ?>
		<div class="formBox signup login">
			<dl class="info">
				<dt><i></i></dt>
				<dd><?php echo $this->language('如果您有 {0} 帐号，请先登录', array(system_nav_language::getInstance()->getSetting()->getTitle()));?>:</dd>
			</dl>
			<form action="<?php echo $this->url('account/login');?>" method="post">
			<?php echo $this->form()->hidden('referer', $this->referer) . "\n";?>
			<?php echo $this->form()->hidden('gender', $this->row->getGender()) . "\n";?>
			<?php if($this->source && $this->access_token) { ?>
			<?php echo $this->form()->hidden('access_token', $this->access_token) . "\n";?>
			<?php echo $this->form()->hidden('oauth', strtolower($this->source->getKey())) . "\n";?>
			<?php echo $this->form()->hidden('avatar', $this->avatar) . "\n";?>
			<?php echo $this->form()->hidden('uid', $this->uid) . "\n";?>
			<dl class="oauth yellow">
				<dt><a><img src="<?php echo $this->avatar;?>" /></a></dt>
				<dd>
					<?php echo $this->language('您已经在 {0} 通过验证', array($this->source->getTitle()));?>
					<code class="red"><?php echo $this->language('请输入登录信息绑定帐号');?></code>
				</dd>
			</dl>
			<?php } ?>
			<dl>
				<dt><?php echo $this->language('帐号');?> :</dt>
				<dd>
					<?php echo $this->form()->text('account', $this->account, array('maxlength' => '100'));?> <span style="color:red;">*</span>
					<code><?php echo $this->language('通常我们帐号是一个有效的Email地址');?></code>
				</dd>
			</dl>
			<dl> 
				<dt><?php echo $this->language('密码');?> :</dt>
				<dd><?php echo $this->form()->password('password', '', array('maxlength' => '30'));?> <span style="color:red;">*</span></dd>
			</dl>
			<dl>
				<dt>&nbsp;</dt>
				<dd>
					<?php echo $this->form()->checkbox('expires', $expireSeconds, array_merge($expireAttr, array('id' => 'expire-1')));?>
					<code><?php echo $this->language('为了您的帐号安全，请不要在公共场合(如学校，网吧等)选择此项');?></code>
				</dd>
			</dl>
			<dl>
				<dt>&nbsp;</dt>
				<dd><button value="submit" class="submit" type="submit"><?php echo $this->language('登录');?></button></dd>
			</dl>
			</form>
			<div class="clear"></div>
		</div>
		<div class="formBox signup">
			<dl class="info">
				<dt class="r"><i></i></dt>
				<dd><?php echo $this->language('如果您还没有 {0} 通行证帐号，请先注册', array(system_nav_language::getInstance()->getSetting()->getTitle()));?>:</dd>
			</dl>			
			<form action="<?php echo $this->url('account/signup');?>" method="post"<?php echo ' autocomplete="off"';?>>
			<?php echo $this->form()->hidden('referer', $this->referer) . "\n";?>
			<?php echo $this->form()->hidden('gender', $this->row->getGender()) . "\n";?>
			<?php if($this->source && $this->access_token) { ?>
			<?php echo $this->form()->hidden('access_token', $this->access_token) . "\n";?>
			<?php echo $this->form()->hidden('oauth', strtolower($this->source->getKey())) . "\n";?>
			<?php echo $this->form()->hidden('avatar', $this->avatar) . "\n";?>
			<?php echo $this->form()->hidden('uid', $this->uid) . "\n";?>
			<dl class="oauth yellow">
				<dt><a><img src="<?php echo $this->avatar;?>" /></a></dt>
				<dd>
					<?php echo $this->language('您已经在 {0} 通过验证', array($this->source->getTitle()));?>
					<code class="red"><?php echo $this->language('请输入注册信息完成注册');?></code>
				</dd>
			</dl>
			<?php } ?>
			<dl>
				<dt><?php echo $this->language('帐号');?> :</dt>
				<dd>
					<?php echo $this->form()->text('account', $this->row->getIdentity(), array('maxlength' => '100'));?> <span style="color:red;">*</span>
					<code><?php echo $this->language('请输入有效的Email地址');?></code>
				</dd>
			</dl>
			<dl> 
				<dt><?php echo $this->language('密码');?> :</dt>
				<dd><?php echo $this->form()->password('password', '', array('maxlength' => '30'));?> <span style="color:red;">*</span></dd>
			</dl>
			<dl> 
				<dt><?php echo $this->language('确认密码');?> :</dt>
				<dd><?php echo $this->form()->password('password1', '', array('maxlength' => '30'));?> <span style="color:red;">*</span></dd>
			</dl>
			<dl>
				<dt><?php echo $this->language('昵称');?> :</dt>
				<dd><?php echo $this->form()->text('nickname', $this->row->getNickname(), array('maxlength' => '50'));?></dd>
			</dl>
			<dl>
				<dt>&nbsp;</dt>
				<dd>
					<?php echo $this->form()->checkbox('expires', $expireSeconds, array_merge($expireAttr, array('id' => 'expire-2')));?>
					<code><?php echo $this->language('为了您的帐号安全，请不要在公共场合(如学校，网吧等)选择此项');?></code>
				</dd>
			</dl>
			<dl>
				<dt>&nbsp;</dt>
				<dd><button value="submit" class="submit" type="submit"><?php echo $this->language('注册');?></button></dd>
			</dl>
			</form>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
</div>
<div class="box">
	<div class="hd">
		<h3><?php echo $this->language('推荐好图');?></h3>
	</div>
	<div class="bd">
		<?php
		echo $this->partial('include/specialList.phtml', 
				array(
					'id' => 'mayLike', 
					'row' => false, 
					'list' => (array) $this->cache()->index()->getRecommendSpecials(array('limit' => '10'))
				)
		);?>
	</div>
	<div class="clear"></div>
</div>
